Alloc

[Memory]


Description:

FUNCTION malloc(n)

Allocates the requested bytes in the heap (dynamic memory) and returns the address (16 bit, unsigned) of the new block. If no memory, NULL (0) is returned.

Parameters:

n: number of bytes

Returns:

16 bits (pointer) unsigned integer. NULL is returned if not enough memory to alloc the block

 

SUB free()

Frees a block previously allocated with malloc, returning it to the heap

 

FUNCTION realloc(n)

Reallocates the requested Bytes in the heap (dynamic memory) and returns the address (16 bit, unsigned) of the new block. If no memory, NULL (0) is returned.

Parameters:

n: Number of Bytes For the new size to reallocate

Returns:

16 bits (Pointer) unsigned integer. NULL is returned if not enough memory to alloc the block


#Include <Alloc.bas>


Supported Plattforms:

ZX Spectrum